package com.group3.hospital.mapper;

import com.group3.hospital.bean.Appointment;
import com.group3.hospital.bean.Doctor;
import com.group3.hospital.bean.Subject;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * @author 尚硅谷
 * @create 2021/12/30
 */
public interface AppointmentMapper {

    @Select("select * from appointment limit 10")
    List<Appointment> queryAll() throws Exception;


    @Select("select count(1) from appointment")
    Integer queryCount();


    @Select("select * from appointment limit #{pageUse},10")
    List<Appointment> queryByPage(Integer pageUse);


    @Select("select * from subject")
    List<Subject> queryAllSubject();

    @Select("insert into appointment(subject_name,appointment_illness,appointment_name,appointment_tel,appointment_date) values(#{subjectName},#{appointmentIllness},#{appointmentName},#{appointmentTel},#{appointmentDate})")
    void addAppointment(Appointment appointment);

    @Select("select * from doctor where doctor_name = #{name}")
    Doctor queryDoctor(String name);
}
